Repository navigation
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
fspy benchmarklinuxmacoswindows |
…nding ELF/SIGSYS tracker Switch Linux file-access tracking from `LD_PRELOAD` + `seccomp_unotify` to the freestanding `target_os = "none"` ELF launcher + `SIGSYS` backend (`fspy_preload_linux`), unify Unix exec/shebang resolution in `no_std` `fspy_shared_unix`, simplify macOS into `fspy_preload_macos`, and add Linux hardening and JS ecosystem E2E cache tests: - `fspy_shared_unix`: rewrite exec/shebang/path resolution to `#![no_std]` shared across `fspy_preload_linux` and `fspy_preload_macos`, with unit tests for Linux, macOS, and `nostd_exec`. - `fspy_preload_linux`: freestanding bare-metal ELF/`SIGSYS` launcher binary built for `x86_64-unknown-none` and `aarch64-unknown-none-softfloat` (checked in CI). - `fspy_preload_macos`: macOS-only `cdylib` replacing `fspy_preload_unix` and `fspy_client_unix`; remove `fspy_seccomp_unotify`. - `fspy`: split `src/unix/` into `src/linux/` and `src/macos/`, add `tests/linux_hardening.rs` and update `tests/untracked_fallback.rs` and existing suites. - `vt_bin`: update `preexisting_ld_preload` snapshot and add 10 JS ecosystem E2E cache fixtures (`biome`, `deno`, `esbuild`, `miniflare`, `oxfmt`, `rspack`, `sass-embedded`, `sharp`, `tailwindcss-v4`, `tsx`). - `CHANGELOG.md`: add user-facing entry referencing all 4 PRs in the stack. Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
wan9chi
force-pushed
the
fspy-linux/4-linux-elf-sigsys-tracker
branch
from
November 27, 2026 00:46
e620865 to
0adff27
Compare
…-elf-sigsys-tracker
Playwright passes `--no-sandbox` by default. Keep the sandbox on so the Linux tracker runs alongside the sandboxed renderer's own seccomp filter, which used to trap the tracker's `process_vm_readv` and crash the renderer. Also mark the launcher's `copy_user_cstr` calls `unsafe`, matching the `fspy_elf_loader` API, which now assumes trapped syscall pointers are valid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-elf-sigsys-tracker
…euse resolve_path_at Now that `fspy_elf_loader` exposes zero-copy `user_cstr` instead of `copy_user_cstr` / `cached_cstr`: - Simplify `report_path_at` to borrow the trapped syscall's path string directly (zero copies and no arena acquire for absolute paths) and delegate relative paths to `fspy_nostd_alloc::fs::resolve_path_at`, matching `fspy_preload_macos`. - Simplify `copy_user_cstr_vec` to use `user_cstr` directly without a 4 KiB chunk buffer loop while keeping the `MAX_EXEC_STRING_LEN` `E2BIG` guard. Co-authored-by: Gemini 4 Neon <noreply@google.com>
…-elf-sigsys-tracker
…alization Remove defences against cases real programs don't hit: - Exec scratch: drop the 64-slot pool, generation counter, and the `kcmp` / `kill(pid, 0)` detachment probe. Each re-routed exec gets one scratch node; only `CLONE_VM` children park theirs after a successful prepare, and the kernel's `set_tid_address` clear lets a later exec trap free it. - argv/envp: copy with `RawExec::to_exec` instead of hand-rolled loops with a 2 MiB `E2BIG` cap; the kernel enforces its own limits on the re-exec. - Launcher materialization: drop the `XDG_RUNTIME_DIR` / `XDG_CACHE_HOME` / `~/.cache` / `/var/tmp` fallback chain. A `noexec` temp directory now warns with a `TMPDIR` hint and runs tasks untracked, as before. - Tests: remove the `kcmp`-denied overflow test and the garbage-pointer `EFAULT` test; the posix_spawn RSS test still guards against leaks. The changelog no longer lists a non-executable stack as a requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-elf-sigsys-tracker
…-elf-sigsys-tracker
… match main's SIP paths
- Child execs always pass the already-validated descriptor to the new
launcher image instead of a pathname to reopen. The file can be
replaced or unlinked in between, and `execve("/proc/self/fd/N")` on an
`O_CLOEXEC` descriptor closed it on exec, which made the launcher panic.
- A relative path whose directory is too long to name (`ENAMETOOLONG`) or
can't be allocated now marks the trace incomplete instead of being
dropped silently. Lookups a sandbox blocks, such as `/proc/self/fd` in
Chromium's PID namespace, still stay silent.
- macOS: ignore `.` components when matching `/bin` and `/usr/bin` for
SIP substitution, as `Path::parent` did on main (`/bin/./sh`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ive paths f624e33 marked a trace incomplete when a relative path's directory was too long to name (`ENAMETOOLONG`) or naming it ran out of memory. Real tasks don't hit either: a workspace directory more than 4 KiB deep doesn't occur, paths outside the workspace are discarded anyway, and a failed page allocation leaves the process in trouble regardless. Restore the silent skip, as main's seccomp path did, and drop the test that built an artificial deep cwd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-elf-sigsys-tracker
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dc6cabf. Configure here.
Add `pagefind@1.6.0` to `packages/tools` and a `pagefind_cache` E2E snapshot fixture (`site/index.html` -> `dist/pagefind/`). On Linux x86-64, `@pagefind/linux-x64` ships a static-PIE (`ET_DYN`, no `PT_INTERP`) executable with no `musl` libc restriction, closing the remaining executable-kind cell alongside dynamic PIE (`biome`/`deno`/ `workerd`/`sass-embedded`), dynamic non-PIE (`bun`/`node`), and static non-PIE (`esbuild`/`typescript` 7). Co-authored-by: Gemini 4 Neon <noreply@google.com>
…before spawn - In `fspy_preload_linux`, record the target path via `report_path_at` (honoring `AT_EMPTY_PATH`) before replaying `execveat(AT_EXECVE_CHECK)` so Linux 6.14+ executability probes are tracked like `faccessat2`. - In `fspy::linux`, construct the tokio `pipe::Receiver` before spawning the launcher child so a setup failure cannot leave an orphaned child. Co-authored-by: Gemini 4 Neon <noreply@google.com>
On Alpine Linux (musl), `/bin/sh` is a multi-call BusyBox binary that dispatches based on `argv[0]`'s basename, so symlinking `/bin/sh` to `.../xxxx...` failed with `applet not found`. Put the length padding in the parent directory and keep the symlink named `sh`. Co-authored-by: Gemini 4 Neon <noreply@google.com>
Now that Bun tests run on Linux (including Alpine musl via `@oven/bun-linux-x64-musl`), run `pnpm --filter vite-task-tools rebuild bun` in `test-musl` before running ignored tests. Narrowed to `bun` so `deno` and `workerd` (which do not ship musl binaries) do not fail postinstall. Co-authored-by: Gemini 4 Neon <noreply@google.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
On Linux,
fspypreviously maintained two separate tracking backends:LD_PRELOADfor dynamically linked glibc binaries andseccomp_unotifyfor static/musl binaries, leaving gaps for direct-syscall runtimes (such as Bun), preexistingLD_PRELOADinterference, and out-of-process supervisor complexity. Switching Linux to a single freestandingtarget_os = "none"ELF/SIGSYSlauncher (fspy_preload_linux) unifies tracking across glibc, musl, static binaries, and direct-syscall runtimes, eliminatesseccomp_unotify, and shares#![no_std]Unix exec/shebang resolution with macOS.Changes
fspy_shared_unix: rewrite Unix exec/shebang/path resolution to#![no_std]shared byfspy_preload_linuxandfspy_preload_macos, with unit tests.fspy_preload_linux: add freestanding bare-metal ELF/SIGSYSlauncher binary forx86_64-unknown-noneandaarch64-unknown-none-softfloat(checked in.github/workflows/ci.yml).fspy_preload_macos: replacefspy_preload_unixandfspy_client_unixwith a macOS-onlycdylib, and removefspy_seccomp_unotify.fspy: splitsrc/unix/intosrc/linux/andsrc/macos/, addtests/linux_hardening.rs, and updatetests/untracked_fallback.rsand existing suites.vt_bin: updatepreexisting_ld_preloadsnapshot and add 10 JS ecosystem E2E cache fixtures (biome,deno,esbuild,miniflare,oxfmt,rspack,sass-embedded,sharp,tailwindcss-v4,tsx).vt_bin: run thevitest_browser_cacheE2E case with Chromium's sandbox on, so the tracker runs alongside the sandboxed renderer's own seccomp filter.CHANGELOG.md: add user-facing changelog entry referencing PRs feat(fspy_nostd): add Unix filesystem, I/O, and path-resolution primitives #1026–feat(fspy): replace Linux LD_PRELOAD and seccomp_unotify with freestanding ELF/SIGSYS tracker #1029.Stack created with GitHub Stacks CLI • Give Feedback 💬
Note
High Risk
Replaces core Linux process-launch and syscall-interception infrastructure used for task cache fingerprints; regressions could break tracking, caching, or sandboxed CI environments.
Overview
On Linux, automatic file-access tracking now runs through a freestanding in-process ELF launcher instead of
LD_PRELOADplus an out-of-processseccomp_unotifysupervisor. The parentfspycrate spawns embeddedfspy_preload_linux(fixed-addressno_stdbinary for x86_64/aarch64), passes bootstrap over__FSPY_BOOTSTRAP, and usesSECCOMP_RET_TRAP/SIGSYSto record filesystem syscalls and chainexecve/execveatfor glibc, musl, static, and direct-syscall runtimes (e.g. Bun).no_new_privs, seccomp probing,noexectemp dirs, and blockedseccompstill fall back to untracked runs withTrackingIncomplete.Platform split and crate cleanup:
src/unix/becomes dedicatedsrc/linux/andsrc/macos/; macOS keepsDYLD_INSERT_LIBRARIESvia renamedfspy_preload_macos(inlined client). Removedfspy_preload_unix,fspy_client_unix, andfspy_seccomp_unotify, along with related workspace/git deps. Shared#![no_std]exec/shebang/path logic lives infspy_shared_unixfor Linux and macOS.CI/tests: cross-clippy includes
fspy_preload_linux; musl CI rebuilds Bun for ignored tests; newlinux_hardeningcoverage, updated untracked-fallback and Node/Bun fixture tests, and changelog entry for the behavior change.Reviewed by Cursor Bugbot for commit 93c4868. Bugbot is set up for automated code reviews on this repo. Configure here.